VERSION 5.00
Begin VB.Form PretestClientForm 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   7560
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      Caption         =   "Next"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   2
      Top             =   6360
      Width           =   1935
   End
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   1
      Top             =   5160
      Visible         =   0   'False
      Width           =   1935
   End
   Begin VCT.TouchScreenListBox HIVTestWaitingList 
      Height          =   7575
      Left            =   480
      TabIndex        =   0
      Top             =   960
      Width           =   5535
      _ExtentX        =   9763
      _ExtentY        =   13361
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Clients who have been registered but demographic details have not been entered."
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   180
      TabIndex        =   4
      Top             =   240
      Width           =   11115
   End
End
Attribute VB_Name = "PretestClientForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim VisitIDArray(0 To 200)

Private Sub Cancel_Button_Click()
   VCTStageForm.Show
   Unload Me
End Sub

Private Sub Form_Load()
   Dim Loc_Sex As String
   Dim Loc_Index As Integer
   
   Next_Button.Enabled = False
   
   'Get the counselor code for this person
   CnUser.Open ConnectString
   Cmd.CommandText = "SELECT COUN_CODE" _
                  & " FROM   counselor" _
                  & " WHERE  COUN_PWD = '" & UserPwd & "'"
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   RsUser.Open Cmd, , adOpenStatic
   COUNCODE = RsUser(0)
   RsUser.Close
   CnUser.Close
   
   'Find all patients registered today who have not had their demographic details recorded
   Loc_Index = 0
   CnUser.Open ConnectString
   Cmd.CommandText = "SELECT CLNTCODE, SEX, TIMEREG, VISITID" _
                  & " FROM   client" _
                  & " WHERE  VDATE = '" & StringDate & "'" _
                  & " AND VISITTYP = '1'" _
                  & " AND SITE = '" & SiteCodeConst & "'" _
                  & " AND REASHERE IS NULL" _
                  & " ORDER BY TIMEREG"
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   RsUser.Open Cmd, , adOpenStatic
   While RsUser.EOF = False
      If RsUser(1) = "1" Then
         Loc_Sex = "M"
      Else
         If RsUser(1) = "2" Then
            Loc_Sex = "F"
         Else
            Loc_Sex = "?"
         End If
      End If
      HIVTestWaitingList.AddItem RsUser(0) & " (" & Loc_Sex & ")"
      VisitIDArray(Loc_Index) = RsUser(3)
      Loc_Index = Loc_Index + 1
      RsUser.MoveNext
   Wend
   RsUser.Close
   CnUser.Close

End Sub

Private Sub HIVTestWaitingList_click()
   Next_Button.Enabled = True
   VISITID = VisitIDArray(HIVTestWaitingList.ListIndex)
End Sub


Private Sub Next_Button_Click()

   'init all variables
   CLIENTCO = ""
   SEX = ""
   SESSTYPE = ""
   COUPTYPE = ""
   VISITTYP = ""
   
   AGE = ""
   RESCLASS = ""
   GROUPSES = ""
   EMPLOYED = ""
   OCCUPAT = ""
   EDUEXPE = ""
   MARSTAT = ""
   MARTYPE = ""
   MARHIST = ""
   KNOWUS1 = ""
   KNOWUS2 = ""
   KNOWUS3 = ""
   KNOWUS4 = ""
   KNOWUS5 = ""
   KNOWUS6 = ""
   KNOWUS7 = ""
   KNOWUS8 = ""
   KNOWUS98 = ""
   KNOWUS99 = ""
   REFERBY = ""
   REASHERE = ""
   
   'sexual history variables
   PRTESTED = ""
   TMONTH = ""
   TYEAR = ""
   PRTESITE = ""
   EVERHAD = ""
   LIFEPART = ""
   SMONTH = ""
   SYEAR = ""
   EVERAPED = ""
   PREG = ""
   TRANSFUS = ""
   PART6MO = -1
   STISYMPT = ""
   TBSYMPT = ""
   REFERRED = ""
   
   CurrPartner = -1
   RecentPartnerDetails = ""
   For I = 0 To 3
      PTYPE(I) = ""
      PNEW(I) = ""
      PSTATUS(I) = ""
      PLTSTMO(I) = ""
      PLTSTYR(I) = ""
      PFPMETH(I) = ""
      PCONUSE(I) = ""
      PCONLST(I) = ""
   Next I
   
   'Get the client's details from the database
   CnUser.Open ConnectString
   Cmd.CommandText = "SELECT CLNTCODE, SEX, SESSTYPE, VISITTYP, COUPCODE" _
                  & " FROM   client" _
                  & " WHERE VISITID = " & VISITID
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   RsUser.Open Cmd, , adOpenStatic
      CLIENTCO = RsUser(0)
      SEX = RsUser(1)
      SESSTYPE = RsUser(2)
      VISITTYP = RsUser(3)
      COUPCODE = RsUser(4)
   RsUser.Close
   CnUser.Close
   
   If SESSTYPE = "02" Then
      CoupleTypeForm.Show
   Else
      COUPTYPE = "98"
      AgeForm.Show
      'PartnersLast6MonthsForm.Show
   End If
   Unload Me
End Sub
